SurviveJS - Webpack and React by Juho Vepsäläinen

SurviveJS - Webpack and React by Juho Vepsäläinen

Author:Juho Vepsäläinen
Language: eng
Format: epub, mobi
Publisher: leanpub.com
Published: 2015-04-10T16:00:00+00:00


You can see how this translates to code below:

app/components/Note.jsx

... const noteSource = { beginDrag(props) { console.log('begin dragging note', props); return {}; } beginDrag(props) { return { id: props.id }; } }; const noteTarget = { hover(targetProps, monitor) { const sourceProps = monitor.getItem(); console.log('dragging note', sourceProps, targetProps); } hover(targetProps, monitor) { const targetId = targetProps.id; const sourceProps = monitor.getItem(); const sourceId = sourceProps.id; if(sourceId !== targetId) { targetProps.onMove({sourceId, targetId}); } } }; ...



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.